<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
<title>运营平台</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="renderer" content="webkit">
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/common.css?v=20170207" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/table.css?v=20170117" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/jquery-ui.css" />
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-1.11.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ui.min.js" type="text/javascript"></script>
 <script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/yunIndex.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ym-datePlugin-0.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/global.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/cheshan/js/common.js" type="text/javascript"></script>
<script type="text/javascript" src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery.placeholder.min.js"></script>
<script type="text/javascript">
 $(function(){
     $("input").placeholder();
     if (navigator.userAgent.indexOf("Safari") > -1) {
       $("input").css("lineHeight","normal !important");
     };
});
</script>

<body>
<div class="header">
<div class="headerCo">
<span>你好,<?php echo ($user_info["real_name"]); ?><a href="<?php echo (WEB_URL); ?>Emp/logout">退出</a></span>
<h1><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_logo.jpg"></h1>
</div>
</div>
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/cashier.css" />
<div class="mian">
    <div class="mianL">
    <dl>
        <dd>
            <a id="menu_sy" href="/Index/index" class="shouye">首页</a>
        </dd>
        <?php foreach ($tree_menu as $key => $value): ?>
          <dd>
            <span id="menu_<?php echo ($value['first_char']); ?>" ><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_jia.jpg"><?php echo ($value['name']); ?></span>
            <ul style="display: none;">
                <?php if (!empty($value['children'])): ?>
                    <?php foreach ($value['children'] as $k => $v): ?>
                        <li><a id='menu_<?php echo ($v["first_char"]); ?>' href="<?php echo ($v['url']); ?>"><?php echo ($v['name']); ?></a></li>
                    <?php endforeach ?>
                <?php endif ?>
            </ul>
        <?php endforeach ?>
    </dl>
</div>

<?php $menu = 'hdgl.cchd'; ?>
<?php $menu=json_encode(explode('.', $menu)); ?>
<script>
    $(function () {
        var cur_menu = '<?php echo ($menu); ?>', cur_menu = eval('[' + cur_menu + ']'), cur_menu = cur_menu[0];
        if (cur_menu == "sy") {
            $("#menu_sy").removeClass('shouye').addClass('current');
        }
        $('#menu_' + cur_menu[0]).click();
        $('#menu_' + cur_menu[0]).find("img").attr("src", "http://img1.isou365.cn/paimai/yunying/images/yun_jie.jpg");
        $(".mianL").css("height", $(document).height() - 95);
        $('#menu_' + cur_menu[1]).addClass('current');
    });
</script>
    <div class="mianR">
        <div class="live-cont">
            <div class="new-live">
                <ul class="modify">
                    <li>
                        <span>活动名称：</span>
                        <?php echo ($arr["scene_activity_arr"]["name"]); ?>
                    </li>
                    <li>
                        <span>活动类型：</span>
                        <?php echo ($arr["scene_activity_arr"]["type"]); ?>
                    </li>
                    <li>
                        <span>所属分公司：</span>
                        <?php echo ($arr["scene_activity_arr"]["branch_name"]); ?>
                    </li>
                    <li>
                        <span>活动规则：</span>
                        <?php echo ($arr["scene_activity_arr"]["rules_type"]); ?>
                    </li>
                    <li>
                        <span>活动时间：</span>
                        <?php echo ($arr["scene_activity_arr"]["starttime"]); ?>  - <?php echo ($arr["scene_activity_arr"]["endtime"]); ?>
                    </li>
                    <?php if($arr['scene_activity_arr']['rules_type_id'] == 1): ?><li class="new-live-loan">
                            <span class="new-live-money">金额：</span>
                            <?php echo ($arr["scene_activity_arr"]["amount"]); ?>
                        </li><?php endif; ?>
                </ul>
            </div>
            <div class="add-rule clearfix" style="display: block;">
                <?php if(is_array($arr["activity_rules_arr"])): foreach($arr["activity_rules_arr"] as $key=>$rules): ?><div class="rule-text">
                        <h4>活动规则</h4>
                            <ul>
                                <li><span>当竞拍价 ≥</span>
                                    <span class="rule-money"><?php echo ($rules["min_bid_price"]); ?></span><i>元</i>
                                </li>
                                <li><span>当竞拍价 ≤</span>
                                    <span class="rule-money"><?php echo ($rules["max_bid_price"]); ?></span><i>元</i>
                                </li>
                                <li><span>减免</span>
                                    <span class="rule-money"><?php echo ($rules["amount"]); ?></span><i>元</i>
                                </li>
                            </ul>
                    </div><?php endforeach; endif; ?>
            </div>
            <div class="yongBtn">
                <input type="button" value="关闭" class="queding" onclick="back();">
                <?php if($act == 'enable'): ?><input type="button" name="btn_enable" value="启用" class="queding" onclick="confirm(<?php echo ($arr["scene_activity_arr"]["id"]); ?>,'enable','1')">
                <?php elseif($act == 'disable'): ?>
                    <input type="button" name="btn_disable" value="禁用" class="queding" onclick="confirm(<?php echo ($arr["scene_activity_arr"]["id"]); ?>,'disable','0')"><?php endif; ?>
            </div>
        </div>
        <div class="clear"></div>
    </div>
</div>

<div class="chenggong1">
    <span class="paidan">您确定要<i>启用</i>活动吗?</span>
    <div class="shenhei-btn">
        <input type="hidden" name="act"  value="" />
        <input type="hidden" name="status"  value="" />
        <input type="hidden" name="activity_id"  value="" />
        <input type="button" value="确定" class="determine" />
        <input type="button" value="取消" class="cancel" />
    </div>
</div>

<script>
   //启用/禁用 窗口
   function confirm(activity_id, act , status) {
       $('.chenggong1').css('display', 'block');
       $('.yunBei').css({'display':'block',"zIndex":999});

       $('input[name=activity_id]').val(activity_id);
       if (act == 'enable') {
           $('.paidan i').text('启用');
           $('input[name=act]').val('enable');
       } else if (act == 'disable') {
           $('.paidan i').text('禁用');
           $('input[name=act]').val('disable');
       }
       $('input[name=status]').val(status);
   }

   //
   $(".determine").on('click', function () {
       var act = $('input[name=act]').val();
       var status = $('input[name=status]').val();
       var activity_id = $('input[name=activity_id]').val();
       var param = {};
       param = {
           'status': status,
           'id': activity_id,
       };
       var btn_obj = $(this);
       btn_obj.val("提交中...").attr("disabled",'disabled');
       $.post('/SceneActivity/enableOrDisableActivity', param, function (data) {
           if (data.code == '200') {
               console.log(data);
               delay_alert('操作成功!');
               setTimeout(function () {
                   back();
               }, 300);
           } else {
               shibai_alert(data.msg)
               btn_obj.val("确定").removeAttr("disabled style");
               $('.chenggong1').fadeOut();
           }
           $('.yunBei').css({'display':'none',"zIndex":999});
       }, 'json');
   });

   $(".cancel").on('click', function () {
       $('.chenggong1').fadeOut();
       $('.yunBei').css({'display':'none',"zIndex":999});
       $('.chenggong1 textarea').remove();
   });


    function back() {
        window.location.href='/SceneActivity/activity_list';
    }
</script>
<div class="yunBei"></div>
<div class="loading"></div>
</body>
</html>